//前进
 function next(){
	 $(".next").attr("disabled","disabled");
	 var data=$("form").serialize();
	 
	 $.ajax({  
		      url:$("form").attr("action"),// 跳转到 action  
		      data:data,  
		      type:'post',  
		     cache:false,
		     success:function(data) {  
		    	 $(".stepContent").html(data);
		    	 	//执行前端状态切换 
		    	  	var length=$(".active").length;
		    	  	if(length<4){
		    	  		$('.wizard>div').slice(0,length+1).addClass("active");
		    	  		$(".progress-bar").css("width",(length+1)*33+"%")
		    	  	}
		    	  	$(".next").removeAttr("disabled");
		    	  	length=$(".active").length;
		    	  	if(length==2){
		    	  		$(".previous").fadeIn("100");
		    	  	}else if(length==4){
		    	  		$(".next").fadeOut("100");
		    	  	}
		      },  
		      error : function(e) {
		    	  $(".error-info").html("<span class='glyphicon glyphicon-remove'></span>   系统发生异常:"+e.responseJSON.message);
		    	  $(".stepContent").html($(".error-info-content").html());
		      }  
		 }); 
	  $(".stepContent").html($(".loading-content").html());
 }
 //后退
 function previous(){
	 var length=$(".active").length;
	  	if(length>1){
	  		$('.wizard>div').removeClass("active");
	  		$('.wizard>div').slice(0,length-1).addClass("active");
	  		$(".progress-bar").css("width",(length-1)*33+"%")
	  	}
	  	length=$(".active").length;
	  if(length==1){
		  $(".previous").fadeOut("100");
	  }else if(length==3){
		  $(".next").fadeIn("100");
	  }
 }
 $(function(){
	 $(".next").attr("disabled","disabled");
	 var aj = $.ajax( {  
		      url:'/gen/step1',// 跳转到 action  
		      data:{},  
		     type:'post',  
		     cache:false,
		     success:function(data) {
		    	 $(".stepContent").html(data);
		    	 $(".next").removeAttr("disabled");
		      },  
		      error : function(e) {
		    	  $(".error-info").html("<span class='glyphicon glyphicon-remove'></span>   系统发生异常:"+e.responseJSON.message);
		    	  $(".stepContent").html($(".error-info-content").html());
		      }  
		 }); 
 });
 